# -*- coding: UTF-8 -*-
"""
@author: tgy
@file: time_module.py
@time: 2021/08/16
"""
import time
import random
import os
import pathlib
import hashlib

def time_format():
    ...
    struct_time = time.localtime(1634334231)
    print(struct_time)
    fmt_time = time.strftime('%Y-%m-%d %H:%M:%S',struct_time)
    print(fmt_time)


def str_to_time():
    ...
    time_s = time.strptime('2021-10-16 05:43:51','%Y-%m-%d %H:%M:%S')
    print(time_s)
    print(time.mktime(time_s))


def random_test():
    print(random.choice([1, 2, 3, 3], k=2))
    random.sample()


def path_lib():
    ...
    path = os.path.abspath('./')
    print(path)
    path = pathlib.Path(path)

    print(path.parent.parent)

    md5 = hashlib.md5()
    md5.update('sss'.encode('utf-8'))


if __name__ == '__main__':
    pass
    # test01()
    # time_format()
    # str_to_time()
    # random_test()
    path_lib()
    import json
    json.loads()